#ifndef MOUSE_INPUT_HH_
# define MOUSE_INPUT_HH_

# include <math/vector.hh>
# include <SDL/SDL.h>
# include "../raycaster/ray.hh"
# include "../camera/camera.hh"

class MouseInput
{
public:
  MouseInput ();
  ~MouseInput ();

  void pressed (Camera* cam);
  void released (Camera* cam);

  void catch_pos (Camera* cam);

  const Vector2d& pressed_pos () const { return p_pos_; }
  const Vector2d& released_pos () const { return r_pos_; }
  bool is_released () const { return is_released_; }
  bool is_interface () const { return is_interface_; }

  void is_interface_set (bool is_interface) { is_interface_ = is_interface; }
  bool is_interface () { return is_interface_; }

  void gen_press_ray ();
  void gen_release_ray ();

  Ray* p_ray_get () const { return p_ray_; }
  Ray* r_ray_get () const { return r_ray_; }

protected:
  Vector2d p_pos_;
  Vector2d r_pos_;

  bool is_released_;

  Ray* p_ray_;
  Ray* r_ray_;

  Vector3f p_cam_;
  Vector3f* p2_cam_;
  Vector3f r_cam_;
  Vector3f* r2_cam_;

  bool new_release_pos_;
  bool is_interface_;
};

#endif /// !MOUSE_INPUT_HH_
